<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <SCRipt src="./lib/vue-2.5.16.js">

    </SCRipt>
    <div id="app">
        <button @click="fifa">动起来</button>
        <button @click="online">停下来</button>
        <h1>{{msg}}</h1>
    </div>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                msg: "山不转水转，你不转我转.",
                time: null,
            },
            methods: {
                fifa() {
                    this.time = setInterval(() => {
                        let vm = this.msg.slice(0, 1)
                        let em = this.msg.slice(1)
                        let om = em + vm
                        this.msg = om
                    }, 100)
                },
                online() {
                    clearInterval(this.time)
                }
            }
        });


    </script>   
</body>

</html>